package com.wzh.common.to.es;

import lombok.Data;

import java.math.BigDecimal;
import java.util.List;

/**
 * "mappings": {
 * "properties": {
 * "skuId": { "type": "long" },
 * "spuId": { "type": "keyword" }, # 精确检索，不分词
 * "skuTitle": {
 * "type": "text", # 全文检索
 * "analyzer": "ik_smart" # 分词器
 * },
 * "skuPrice": { "type": "keyword" },
 * "skuImg": {
 * "type": "keyword",
 * "index": false, # false 不可被检索
 * "doc_values": false # false 不可被聚合
 * },
 * "saleCount":{ "type":"long" }, # 商品销量
 * "hasStock": { "type": "boolean" }, # 商品是否有库存
 * "hotScore": { "type": "long"  }, # 商品热度评分
 * "brandId":  { "type": "long" }, # 品牌id
 * "catalogId": { "type": "long"  }, # 分类id
 * "brandName": {  # 品牌名，只用来查看，不用来检索和聚合
 * "type": "keyword",
 * "index": false,
 * "doc_values": false
 * },
 * "brandImg":{  # 品牌图片，只用来查看，不用来检索和聚合
 * "type": "keyword",
 * "index": false,
 * "doc_values": false
 * },
 * "catalogName": {  # 分类名，只用来查看，不用来检索和聚合
 * "type": "keyword",
 * "index": false,
 * "doc_values": false
 * },
 * "attrs": {  # 属性对象
 * "type": "nested", # 嵌入式，内部属性
 * "properties": {
 * "attrId": {"type": "long"  },
 * "attrName": { # 属性名
 * "type": "keyword",
 * "index": false,
 * "doc_values": false
 * },
 * "attrValue": { "type": "keyword" }  # 属性值
 * }
 * }
 * }
 * }
 */
@Data
public class SkuEsModel {
    private Long skuId;
    private Long spuId;
    private String skuTitle;
    private BigDecimal skuPrice;
    private String skuImg;
    private Long saleCount;
    /**
     * 是否有库存
     */
    private Boolean hasStock;
    /**
     * 热度
     */
    private Long hotScore;
    private Long brandId;
    private Long catalogId;
    private String brandName;
    private String brandImg;
    private String catalogName;
    private List<Attrs> attrs;

    @Data
    public static class Attrs {
        private Long attrId;
        private String attrName;
        private String attrValue;
    }
}
